home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / windows / fpnl3.zip / FPNL3DCU.ZIP / VIEWTOOL.PAS < prev   
Pascal/Delphi Source File  |  1996-08-02  |  1KB  |  72 lines

  1. unit ViewToolbars;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, TFloatPanel;
  8.  
  9. type
  10.   TViewToolbarsDlg = class(TForm)
  11.     sbxCheckBoxes: TScrollBox;
  12.     cmdClose: TButton;
  13.   private
  14.     { Private declarations }
  15.   public
  16.     { Public declarations }
  17.     procedure ckbClick(Sender: TObject);
  18.   end;
  19.  
  20.  
  21.  
  22. var
  23.   ViewToolbarsDlg: TViewToolbarsDlg;
  24.  
  25.  
  26. procedure ShowViewToolbarsDlg;
  27.  
  28. implementation
  29.  
  30.  
  31. {$R *.DFM}
  32.  
  33. procedure ShowViewToolbarsDlg;
  34. var
  35.   tflpnl : TFloatpnl;
  36.   tcb    : TCheckBox;
  37.   i : integer;
  38. begin
  39.  
  40.   ViewToolbarsDlg := TViewToolbarsDlg.Create(Application);
  41.  
  42.   for i := 0 to ToolbarList.count -1 do
  43.   begin
  44.     tflpnl := Toolbarlist.items[i];
  45.     tcb := TCheckBox.Create(ViewToolbarsDlg.sbxCheckBoxes);
  46.     tcb.Parent := ViewToolbarsDlg.sbxCheckBoxes;
  47.     tcb.left := 4;
  48.     tcb.height := 21;
  49.     tcb.width := 223;
  50.     tcb.name := 'ckb' + InttoStr(i);
  51.     tcb.top := 2 +  (i * 21);
  52.     tcb.caption := tflpnl.caption;
  53.     tcb.checked := tflpnl.VisibleDock;
  54.     tcb.onclick := ViewToolbarsDlg.ckbClick;
  55.  
  56.   end ;
  57.   ViewToolbarsDlg.ShowModal;
  58. end;
  59.  
  60. procedure TViewToolbarsDlg.ckbClick(Sender: TObject);
  61. var
  62.   tflpnl : TFloatpnl;
  63.   tcb    : TCheckBox;
  64.   i : integer;
  65. begin
  66.   i := StrToInt(Copy((Sender as TCheckbox).name,4,2));
  67.   tflpnl := Toolbarlist.items[i];
  68.   tflpnl.VisibleDock := (sender as TCheckbox).checked;
  69. end;
  70.  
  71. end.
  72.